package com.example.administrator.boltshow.viewone;/*
 *@创建者 lnn
 *@创建时间2016/8/311:01
 *@描述 ${TODO}
*/

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.RectF;
import android.util.AttributeSet;
import android.widget.TextView;

public class TextViews  extends TextView{
    private Paint mPaint = new Paint();
    public TextViews(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    @Override
    protected void onDraw(Canvas canvas) {
        super.onDraw(canvas);
        int paddingTop = getPaddingTop();
        int paddingRight = getPaddingRight();
        int paddingLeft = getPaddingLeft();
        int paddingBottom = getPaddingBottom();

        mPaint.setStyle(Paint.Style.STROKE);
        int height = getHeight();
        int width = getWidth();
        mPaint.setColor(Color.RED);
        RectF rectF  = new RectF(0,0,width,height);
        canvas.drawRect(rectF,mPaint);
    }
}
